<table class="table table-bordered">
    <table class="table table-bordered">
        <tbody>
        <tr>
            <td colspan="8"  class='form-inline'>&nbsp;&nbsp;所属单位
                <select class="form-control"  class='form-inline'>
                    <option value="touzi" name="touzi" style="width: 2cm">广州友和房地产投资有限公司</option>
                    <option value="jiudian" name="jiudian" style="width: 2cm">广州友和酒店有限公司</option>
                    <option value="guanli" name="guanli" style="width: 2cm">广州友和酒店管理服务有限公司佛山分公司</option>
                    <option value="gongsi" name="gongsi" style="width: 2cm">广州友和公寓管理有限公司越秀分公司</option>
                    <option value="keji" name="keji" style="width: 2cm">广州安住信息科技有限公司</option>
                    <!--<option value="3" >调休</option>-->
                </select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                流水号：<input type="text" class="form-control"  id="number" name="number" readonly="readonly"/>
            </td>
        </tr>
        <tr>
            <td >申请部门</td>
            <td><input type="text" class="form-control" required name="department"/></td>
            <td>申请人</td>
            <td><input type="text" class="form-control" required name="person"/></td>
            <td>填表时间</td>
            <td><input type="text" class="form-control"  required id="tianbiaoTime" name="tianbiaoTime"/></td>
            <td>预计时间</td>
            <td><input type="text" class="form-control"  required id="yujuTime" name="yujuTime"/></td>
        </tr>
        <tr>
            <td >工作地点</td>
            <td colspan="2"><input type="text" class="form-control" required name="didian"/></td>
            <td>下单跟进人</td>
            <td colspan="2"><input type="text" class="form-control" required name="genjin"/></td>
            <td>跟进人电话</td>
            <td colspan="2"><input type="text" class="form-control"  required name="del"/></td>
        </tr>
        <tr>
            <td style="text-align: center">工程内容</a></td>
            <td  style="height: 3cm" colspan="3"><textarea class="form-control" name="content" style="height: 2.5cm"></textarea></td>
            <td style="text-align: center">备注</a></td>
            <td  style="height: 3cm" colspan="3"><textarea class="form-control" name="remarks" style="height: 2.5cm"></textarea></td>
        </tr>

        <tr>
            <td class='form-inline'>&nbsp;&nbsp;执行人<td  >
                <select class="form-control"  class='form-inline' style="width: 8cm">
                    <option value="buchong" name="buchong" style="width: 2cm">见工程部审批备注</option>
                </select></td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <td style="width: 3cm">发单时间</td>
            <td colspan="2"><input type="text" class="form-control" required id="fadanTime" name="fadanTime"/></td>
            <td>完成时间</td>
            <td colspan="2"><input type="text" class="form-control" required id="finshTime" name="finshTime"/></td>
            </td>
        </tr>
        <tr>
            <td style="text-align: center;width: 2.5cm;" >工程部意见</a></td>
            <td  style="height: 3cm" colspan="8"><textarea class="form-control" name="gongc" style="height: 2.5cm"></textarea></td>
        </tr>
        <tr>
            <td colspan="8" style="text-align: center;" >领用明细<a style="color:red;">（限制3行）</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <select class="form-control"  class='form-inline'>
                <option value="buchong" name="caiwu" style="width: 2cm">无需财务审核</option>
                <option value="buchong" name="yao" style="width: 2cm">需要财务审核</option>
            </select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </td>
        </tr>
        <tr>
        <td  style="height: 3cm" colspan="8"><textarea class="form-control" name="gongc" style="height: 2.5cm"></textarea></td>
        </tr>
        <tr>
            <td >开始时间</td>
            <td ><input type="text" class="form-control"  required id="startTime" name="startTime"/></td>
            <td>结束时间</td>
            <td ><input type="text" class="form-control"  required id="endTime" name="endTime"/></td>
            <td style="width: 3cm"> 实际耗时(小时)</td>
            <td style="width: 3cm">工资(时薪)</td>
            <td style="width: 3cm">基本检查费</td>
            <td>工程收费(元)</td>
        </tr>

        <tr>
            <td >材料费</td>
            <td ><input type="text" class="form-control"  required name="cail"  oninput="preSubmit(this)" pattern="^\d+$" /></td>
            <td>附加费</td>
            <td ><input type="text" class="form-control" required name="fujia"  oninput="preSubmit(this)" pattern="^\d+$"/></td>
            <td><input type="text" class="form-control" required name="shiji"  oninput="preSubmit(this)" pattern="^\d+$"/></td>
            <td><input type="text" class="form-control"  required name="gongzi"  oninput="preSubmit(this)" pattern="^\d+$"/></td>
            <td><input type="text" class="form-control" required name="jiben"  oninput="preSubmit(this)" pattern="^\d+$"/></td>
            <td><input type="text" class="form-control" required name="gongcheng"  oninput="preSubmit(this)" pattern="^\d+$"/></td>
        </tr>
        </tbody>
    </table>
</table>
<script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;


        laydate.render({
            elem: '#tianbiaoTime'
        });

        laydate.render({
            elem: '#fadanTime'
        });
        laydate.render({
            elem: '#yujuTime'
        });
        laydate.render({
            elem: '#entryTime'
        });
        laydate.render({
            elem: '#finshTime'
        });
        laydate.render({
            elem: '#startTime'
        });

        laydate.render({
            elem: '#endTime'
        });
    });

    $(function () {
        function S4() {
            return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
        }

        function guid() {
            return (S4() + S4() + S4());
        }

        var myID =guid();
        console.log(myID)
        $("#number").val(myID)

    })

    /**
     * 重写表单提交前事件
     * @returns {boolean}
     */
    // function preSubmit() {
    //     console.log('重写表单提交前事件...');
    //     // 此处编写任务提交前的业务逻辑（如果需要，不需要就不用重写此方法了）
    //     // alert('不允许提交');
    //     // return false;   // 返回false可阻止继续表单提交
    // }


    function preSubmit(i) {
        if(i.validity.patternMismatch ===true){
            i.setCustomValidity("请输入符合格式的数字");
            i.validationMessage("请输入符合格式的数字");
        }
        i.setCustomValidity("");
    }

</script>
</body>
</html>